class AddAdminUser < ActiveRecord::Migration
  def self.up
    role = Role.create(
      :name => "Administrator",
      :code => "Admin")
    role.save!
    user = User.create(
      :name => "admin",
      :password => '123',
      :role_id => role.id,
      :first_name => 'Admin',
      :last_name => 'Admin'
      )
    user.save!
  end

  def self.down
    User.delete_all 
    Role.delete_all
  end
end
